﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;

namespace 数据迁移工具.Common.DbContext
{
    public class SqliteDbContext : SugarDbContext
    {
        public SqliteDbContext(ConnectionConfig config) : base(config)
        {
        }

        public override List<TableInfo> GetTableInfos(string dbName)
        {
            string sql = "SELECT name as TbName FROM sqlite_master WHERE type='table' and name not like 'sqlite_%'";
            return DB.Ado.SqlQuery<TableInfo>(sql);
        }

        protected override List<ViewDefinition> GetViewDefinitions(string mode)
        {
            return base.GetViewDefinitions(mode);
        }

        public override void ViewConvert(string srcMode, DbType dbType, string targetId, string dstDbName)
        {
            List<ViewDefinition> definitions = GetViewDefinitions(srcMode);
        }

        public override void DbMigrate(DbType targetType, string targetId, string dbName, string namesp = "Default.Models")
        {
            base.DbMigrate(targetType, targetId, dbName, namesp);
        }

       
    }
}
